package store

import (
	"context"
	"manager/model"
	"manager/model/entity"
)

type IFirmwaresTactic interface {
	// Create 创建
	Create(ctx context.Context, e *entity.FirmwaresTactic) (int64, error)
	// Find 查找详情
	Find(ctx context.Context, in *model.FirmwaresTacticInfoRequest) (*entity.FirmwaresTactic, error)
	// Update 更新
	Update(ctx context.Context, id int64, updates map[string]interface{}) error
	// Delete 删除
	Delete(ctx context.Context, id int64) error
	// List 列表查询
	List(ctx context.Context, in *model.FirmwaresTacticListRequest) (int, []*entity.FirmwaresTactic, error)
	// ExecTransaction db事务执行
	ExecTransaction(ctx context.Context, callback func(ctx context.Context) error) error
	// FindUpgradePlanByAllAndSn 查询指定全部设备计划
	FindUpgradePlanByAllAndSn(snCode string) (*model.UpgradePlanBySnResponse, error)
	// FindUpgradePlanBySnAndType 查询指定型号设备计划
	FindUpgradePlanBySnAndType(snCode string, typeId int64) (*model.UpgradePlanBySnResponse, error)
	// FindUpgradePlanBySn 查询指定车辆设备计划
	FindUpgradePlanBySn(snCode string, status []int) (*model.UpgradePlanBySnResponse, error)
	CheckExistFirmwareTactic(firmwareId int64) (int64, error)
	CheckExistActivePlanByRange(int) (int64, error)
}
